/* eslint-disable */

import Vue from "vue";
import Router from "vue-router";
import etlRouter from './etl'

Vue.use(Router);
/* Layout 主框架 */
import HomeLayout from "@/views/layout/Layout";
/* Router Modules 路由模块 */
export const constantRoutes = [
   
    {
        path: "/login",
        component: () => import("@/views/login"),
        hidden: true
    },
    {
        path: "/404",
        component: () => import("@/views/404"),
        hidden: true
    },
    {
        path: '',
        name: '首页',
        component: HomeLayout,
        redirect: 'home',
        iconCls: 'el-icon-message',
        meta: { hidden: true},
        children: [
            {
                path: 'home',
                component: () => import('@/views/home'),
                name: 'home',
                meta: {title: '首页', icon: 'el-icon-message',
                    desc:'',
                    Auth: "login", hidden: true}
            },
            {
                path: 'authorize',
                component: () => import('@/views/authorize'),
                name: 'authorize',
                meta: {title: '无权操作', icon: 'el-icon-message',Auth: "login", hidden: true}
            }
        ]
    },
    etlRouter,
     
]
const createRouter = () =>
    new Router({
        mode: "history", // require service support
        base: "/itbi/",
        code: "itbi",
        scrollBehavior: () => ({y: 0}),
        routes: constantRoutes
    });
const router = createRouter();
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
    const newRouter = createRouter();
    router.matcher = newRouter.matcher; // reset router
}

export default router;
